// PipeTable.h: interface for the PipeTable class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_PIPETABLE_H__3A08F7E4_4281_4CA4_AEAD_EDB987C9DD8D__INCLUDED_)
#define AFX_PIPETABLE_H__3A08F7E4_4281_4CA4_AEAD_EDB987C9DD8D__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "unit.h"
#include "MultiRecordsDatabaseElement.h"
#include "PipeTableRecord.h"

namespace PDMS
{
	namespace PDMSDBIF
	{
		typedef DatabaseTableTemplate<PipeTableRecord> PipeTableBase;
		class DllExport PipeTable : public PipeTableBase 
		{
			DECLARE_REGISTER_MAP( PipeTable );

		public:
			void SetID( unsigned long lID ){
				m_pCurRecord->SetID( lID );
			}
			
			void SetParentID( unsigned long lParentID ){
				ASSERT( m_pCurRecord != NULL );
				m_pCurRecord->SetParentID( lParentID );
			}
			
		public:
			PipeTable();
			virtual ~PipeTable();

			void SetShopFlag( BOOL  );
			void SetBuildFlag( BOOL  );
			void SetPipeBore( LengthUnit );
			void SetPressure( PressureUnit );
			void SetCaseRef( const StdString& );
			void SetDescription( const StdString& );
			void SetFluRef( const StdString& );
			void SetFunction( const StdString& );
			void SetIspec( const StdString& );
			void SetMatRef( const StdString& );
			void SetPspec( const StdString& );
			void SetPurpose( const StdString& );
			void SetTspec( const StdString& );
			void SetTemperature( TemperatureUnit );
			void SetPtspec( const StdString& );
		
			BOOL GetShopFlag();
			BOOL GetBuildFlag();
			LengthUnit GetPipeBore();
			PressureUnit GetPressure();
			StdString GetCaseRef();
			StdString GetDescription();
			StdString GetFluRef();
			StdString GetFunction();
			StdString GetIspec();
			StdString GetMatRef();
			StdString GetPspec();
			StdString GetPurpose();
			StdString GetTspec();
			TemperatureUnit GetTemperature();
			StdString GetPtspec();
			unsigned long GetID();
			unsigned long GetParentID();

		protected:
			virtual StdString GetOpenSQL( const StdString& strCondition );
			virtual StdString GetTableName();
			virtual void SetData( RecordPtr_ ptr );
		};
	}
}
#endif // !defined(AFX_PIPETABLE_H__3A08F7E4_4281_4CA4_AEAD_EDB987C9DD8D__INCLUDED_)
